Skip to content

Fix SyntaxWarning: invalid escape sequence errors on Python 3.12#18

Open
pirate wants to merge 1 commit intoxmonader:masterfrom
pirate:patch-1
Open

Fix SyntaxWarning: invalid escape sequence errors on Python 3.12#18
pirate wants to merge 1 commit intoxmonader:masterfrom
pirate:patch-1

Conversation

@pirate
Copy link

@pirate pirate commented Oct 4, 2024

When using this library with Python 3.12, several warnings are displayed:

./.venv/lib/python3.12/site-packages/sonic/client.py:115: SyntaxWarning: invalid escape sequence '\('
  matches = re.findall("protocol\((\w+)\)", text)
./.venv/lib/python3.12/site-packages/sonic/client.py:134: SyntaxWarning: invalid escape sequence '\('
  matches = re.findall("buffer\((\w+)\)", text)
./.venv/lib/python3.12/site-packages/sonic/client.py:153: SyntaxWarning: invalid escape sequence '\w'
  matches = re.findall("PENDING (\w+)", text)

This PR fixes the issue by making marking these strings as r'...' "raw" strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant